(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 11.2' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     10182,        275]
NotebookOptionsPosition[      7836,        232]
NotebookOutlinePosition[      8184,        247]
CellTagsIndexPosition[      8141,        244]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Sample Data", "Subsection",
 CellChangeTimes->{{3.7102213947258806`*^9, 3.710221406446529*^9}, {
  3.7160968294714556`*^9, 
  3.7160968298798575`*^9}},ExpressionUUID->"927604f0-3509-446e-9c71-\
a24f9448a25f"],

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "url", "=", 
   "\"\<http://www.loci.wisc.edu/files/software/data/embryo2.zip\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"progress", "=", " ", "0."}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"progFunction", "[", 
   RowBox[{"_", ",", " ", "\"\<progress\>\"", ",", " ", 
    RowBox[{"{", 
     RowBox[{"dlnow_", ",", " ", "dltotal_", ",", " ", "_", ",", " ", "_"}], 
     "}"}]}], "]"}], ":=", " ", 
  RowBox[{"Quiet", "[", 
   RowBox[{"progress", " ", "=", " ", 
    RowBox[{"dlnow", "/", "dltotal"}]}], "]"}]}]}], "Input",
 CellChangeTimes->{
  3.7102213181219745`*^9},ExpressionUUID->"ac825f9c-f8e2-42e8-b855-\
4c092b8dccbd"],

Cell[BoxData[
 RowBox[{"Dynamic", "[", 
  RowBox[{"ProgressIndicator", "[", "progress", "]"}], "]"}]], "Input",Express\
ionUUID->"12469f80-56b5-4c68-8175-30380b91ec4b"],

Cell[BoxData[
 RowBox[{"URLSaveAsynchronous", "[", 
  RowBox[{"url", ",", " ", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{"$UserDocumentsDirectory", ",", " ", "\"\<embryo2.zip\>\""}], 
     "}"}], "]"}], ",", " ", "progFunction", ",", " ", 
   RowBox[{"\"\<Progress\>\"", "\[Rule]", "True"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.710220950696994*^9, 3.710220958012452*^9}, {
  3.7102210839364767`*^9, 3.710221109326025*^9}, {3.7102212315150023`*^9, 
  3.710221235063882*^9}, {3.7102213408195724`*^9, 
  3.7102213566741524`*^9}},ExpressionUUID->"4e78da3e-8b76-45c0-93e9-\
24a26e37897f"],

Cell[BoxData[
 RowBox[{"filePaths", "=", 
  RowBox[{"ExtractArchive", "[", 
   RowBox[{
    RowBox[{"FileNameJoin", "[", 
     RowBox[{"{", 
      RowBox[{"$UserDocumentsDirectory", ",", " ", "\"\<embryo2.zip\>\""}], 
      "}"}], "]"}], ",", "$UserDocumentsDirectory"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.7102216356196957`*^9, 
  3.7102216835447893`*^9}},ExpressionUUID->"88c88ad0-dbe2-4e1a-9c78-\
13c944ddbb6d"],

Cell[BoxData[
 RowBox[{"filePath", "=", 
  RowBox[{"filePaths", "[", 
   RowBox[{"[", "1", "]"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.7102217944708843`*^9, 
  3.7102218040610075`*^9}},ExpressionUUID->"40f3aa33-bdc4-4e4f-85d3-\
86e9b51e7990"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Read Number of Series", "Subsection",
 CellChangeTimes->{{3.710221422025346*^9, 3.7102214253795357`*^9}, {
  3.712302623420561*^9, 
  3.7123026339407005`*^9}},ExpressionUUID->"568a5d7a-3f8e-42d9-8595-\
fb86ec8d0c41"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<BioFormatsLink`\>\"", "]"}]], "Input",
 CellChangeTimes->{{3.7102203312725143`*^9, 
  3.710220337935851*^9}},ExpressionUUID->"ca1c8d24-21e5-43d0-8bf7-\
90f01c56fa00"],

Cell[BoxData[
 RowBox[{"BioFormatsLink`Private`ReadSeriesCount", "[", "filePath", 
  "]"}]], "Input",
 CellChangeTimes->{{3.7102203836252747`*^9, 3.7102203922474885`*^9}, {
  3.7102237812588735`*^9, 3.7102237843598228`*^9}, {3.7122935883071785`*^9, 
  3.712293594772873*^9}, {3.712300346090947*^9, 3.712300357242594*^9}, {
  3.7123026456768665`*^9, 
  3.7123026595275545`*^9}},ExpressionUUID->"3ec38d6a-af20-4aac-90f9-\
13bec7929244"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Read Image", "Subsection",
 CellChangeTimes->{{3.710221422025346*^9, 
  3.7102214253795357`*^9}},ExpressionUUID->"41eee320-4dc8-4072-9832-\
696dd82482a8"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<BioFormatsLink`\>\"", "]"}]], "Input",
 CellChangeTimes->{{3.7102203312725143`*^9, 
  3.710220337935851*^9}},ExpressionUUID->"0ec547c8-2d54-4ebc-8dbc-\
42d190683e8d"],

Cell[BoxData[
 RowBox[{
  RowBox[{"embryoSeries1", "=", 
   RowBox[{"BlockMap", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"ColorCombine", "[", 
       RowBox[{"#", ",", "\"\<RGB\>\""}], "]"}], "&"}], ",", 
     RowBox[{"First", "@", 
      RowBox[{"BioFormatsLink`Private`ReadImage", "[", 
       RowBox[{"filePath", ",", "1"}], "]"}]}], ",", "3"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.7102203836252747`*^9, 3.7102203922474885`*^9}, {
  3.7102237812588735`*^9, 3.7102237843598228`*^9}, {3.7122935883071785`*^9, 
  3.712293594772873*^9}, {3.712300346090947*^9, 
  3.712300357242594*^9}},ExpressionUUID->"5c32f1b6-46c2-4ec4-9d6d-\
56326c87f297"],

Cell[BoxData[
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"ImageAdjust", "[", 
    RowBox[{
    "embryoSeries1", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}], 
    "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"k", ",", "1", ",", 
     RowBox[{"Length", "[", "embryoSeries1", "]"}], ",", "1"}], "}"}]}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.7123003648355885`*^9, 
  3.712300367838256*^9}},ExpressionUUID->"a736a104-c633-4433-a477-\
190be85e32bb"],

Cell[BoxData[
 RowBox[{
  RowBox[{"embryoSeries2", "=", 
   RowBox[{"First", "@", 
    RowBox[{"BioFormatsLink`Private`ReadImage", "[", 
     RowBox[{"filePath", ",", "2"}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{{3.712300389970679*^9, 
  3.712300403203456*^9}},ExpressionUUID->"5dd901ee-3d5b-4bfd-bfce-\
ce1aa88ec143"],

Cell[BoxData[
 RowBox[{"Manipulate", "[", 
  RowBox[{
   RowBox[{"ImageAdjust", "[", 
    RowBox[{
    "embryoSeries2", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}], 
    "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"k", ",", "1", ",", 
     RowBox[{"Length", "[", "embryoSeries2", "]"}], ",", "1"}], "}"}]}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.7123003648355885`*^9, 3.712300367838256*^9}, {
  3.7123004120669594`*^9, 
  3.7123004150664153`*^9}},ExpressionUUID->"2d72d564-77c6-4498-b68b-\
eb3a965d9439"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Read Original Metadata", "Subsection",
 CellChangeTimes->{{3.710221422025346*^9, 3.710221433975211*^9}, {
  3.710579703757137*^9, 
  3.7105797053179245`*^9}},ExpressionUUID->"0f56b16c-7f18-4fb1-b4d4-\
f0e3ea2dd9bb"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<BioFormatsLink`\>\"", "]"}]], "Input",ExpressionUU\
ID->"ee35b950-d150-465c-a805-f996d415c094"],

Cell[BoxData[
 RowBox[{"BioFormatsLink`Private`ReadOriginalMetadata", "[", "filePath", 
  "]"}]], "Input",
 CellChangeTimes->{
  3.710220471095227*^9, {3.710223798769579*^9, 3.7102237999216747`*^9}, {
   3.7105796982365007`*^9, 3.710579699431579*^9}, {3.7123004587745943`*^9, 
   3.7123004737244077`*^9}},ExpressionUUID->"d7ebccb9-ed54-4fdb-a358-\
763426993721"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Read OME-XML Metadata", "Subsection",
 CellChangeTimes->{{3.710221422025346*^9, 3.710221433975211*^9}, {
  3.710579703757137*^9, 
  3.7105797140751343`*^9}},ExpressionUUID->"55339ccf-a2df-4515-b50e-\
263dac665492"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<BioFormatsLink`\>\"", "]"}]], "Input",ExpressionUU\
ID->"3a151e0e-8d22-411c-ae74-48b71cf7f41f"],

Cell[BoxData[
 RowBox[{"BioFormatsLink`Private`ReadOMEXMLMetadata", "[", "filePath", 
  "]"}]], "Input",
 CellChangeTimes->{
  3.710220471095227*^9, {3.710223798769579*^9, 3.7102237999216747`*^9}, {
   3.7105796982365007`*^9, 3.710579721918377*^9}, {3.7123004783019595`*^9, 
   3.7123005079098825`*^9}, {3.712300778084772*^9, 
   3.712300778235078*^9}},ExpressionUUID->"178bf8c0-c788-4ff6-aff4-\
5688346db744"]
}, Open  ]]
},
WindowSize->{798, 833},
WindowMargins->{{339, Automatic}, {33, Automatic}},
FrontEndVersion->"11.2 for Microsoft Windows (64-bit) (September 10, 2017)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 214, 4, 53, "Subsection",ExpressionUUID->"927604f0-3509-446e-9c71-a24f9448a25f"],
Cell[797, 28, 695, 19, 67, "Input",ExpressionUUID->"ac825f9c-f8e2-42e8-b855-4c092b8dccbd"],
Cell[1495, 49, 168, 3, 28, "Input",ExpressionUUID->"12469f80-56b5-4c68-8175-30380b91ec4b"],
Cell[1666, 54, 611, 12, 48, "Input",ExpressionUUID->"4e78da3e-8b76-45c0-93e9-24a26e37897f"],
Cell[2280, 68, 420, 10, 48, "Input",ExpressionUUID->"88c88ad0-dbe2-4e1a-9c78-13c944ddbb6d"],
Cell[2703, 80, 246, 6, 28, "Input",ExpressionUUID->"40f3aa33-bdc4-4e4f-85d3-86e9b51e7990"]
}, Open  ]],
Cell[CellGroupData[{
Cell[2986, 91, 222, 4, 53, "Subsection",ExpressionUUID->"568a5d7a-3f8e-42d9-8595-fb86ec8d0c41"],
Cell[3211, 97, 208, 4, 28, "Input",ExpressionUUID->"ca1c8d24-21e5-43d0-8bf7-90f01c56fa00"],
Cell[3422, 103, 434, 8, 28, "Input",ExpressionUUID->"3ec38d6a-af20-4aac-90f9-13bec7929244"]
}, Open  ]],
Cell[CellGroupData[{
Cell[3893, 116, 160, 3, 53, "Subsection",ExpressionUUID->"41eee320-4dc8-4072-9832-696dd82482a8"],
Cell[4056, 121, 208, 4, 28, "Input",ExpressionUUID->"0ec547c8-2d54-4ebc-8dbc-42d190683e8d"],
Cell[4267, 127, 663, 16, 48, "Input",ExpressionUUID->"5c32f1b6-46c2-4ec4-9d6d-56326c87f297"],
Cell[4933, 145, 464, 13, 28, "Input",ExpressionUUID->"a736a104-c633-4433-a477-190be85e32bb"],
Cell[5400, 160, 327, 8, 28, "Input",ExpressionUUID->"5dd901ee-3d5b-4bfd-bfce-ce1aa88ec143"],
Cell[5730, 170, 517, 14, 28, "Input",ExpressionUUID->"2d72d564-77c6-4498-b68b-eb3a965d9439"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6284, 189, 221, 4, 53, "Subsection",ExpressionUUID->"0f56b16c-7f18-4fb1-b4d4-f0e3ea2dd9bb"],
Cell[6508, 195, 137, 2, 28, "Input",ExpressionUUID->"ee35b950-d150-465c-a805-f996d415c094"],
Cell[6648, 199, 362, 7, 28, "Input",ExpressionUUID->"d7ebccb9-ed54-4fdb-a358-763426993721"]
}, Open  ]],
Cell[CellGroupData[{
Cell[7047, 211, 220, 4, 53, "Subsection",ExpressionUUID->"55339ccf-a2df-4515-b50e-263dac665492"],
Cell[7270, 217, 137, 2, 28, "Input",ExpressionUUID->"3a151e0e-8d22-411c-ae74-48b71cf7f41f"],
Cell[7410, 221, 410, 8, 28, "Input",ExpressionUUID->"178bf8c0-c788-4ff6-aff4-5688346db744"]
}, Open  ]]
}
]
*)

